mutate(v2smgovshut = 1-v2smgovshut)
# model government capacity explains 17% of the internet shutdown
# Government capacity is a weak indicator of internet shutdown
mod <- lm(v2smgovsmcenprc~v2smorgelitact, data=d3)
plot(v2smgovsmcenprc~v2smorgelitact, data=d3)
abline(mod, col="red", lwd=3)
text(v2smgovsmcenprc~v2smorgelitact, labels=d3$country_name,
data=d3, cex=0.9, font=2)
mod <- lm(v2smgovsmcenprc~v2x_libdem +v2smgovsmmon+v2smgovshutcap+v2smorgelitact, data=d3)
summary(mod)
plot(mod, data=d3)
mod <- lm(v2smgovsmcenprc~v2x_libdem +v2smgovsmmon+v2smorgelitact, data=d3)
plot(mod, data=d3)
summary(mod)
mod <- lm(v2smgovsmcenprc~v2smorgelitact, data=d3)
mod
mod <- lm(v2smgovshut~v2x_libdem + v2smgovshutcap + v2smorgelitact, data=d3)
warnings()
summary(mod)
data$v2smgovfilprc
data2$v2smgovfilprc
data2$v2smgovfilprc <- 0 - data2$v2smgovfilprc
data2$v2smgovfilprc
data2 <- readRDS("Country_Year_V-Dem_Full+others_R_v12/V-Dem-CY-Full+Others-v12.rds")
range(data2$v2smgovfilprc)
max(data2$v2smgovfilprc)
d3
max(d3$v2smgovfilprc)
min(d3$v2smgovfilprc)
nodes <- readRDS("processed_data/nodes_R1.RDS")
nodes <- readRDS("/Users/ishitagopal/OneDrive - The Pennsylvania State University/Box Migration Data/Projects/state_covid_policy/analysis/network_analysis/processed_data/nodes_R1.Rds")
rm(list=ls())
nodes <- readRDS("/Users/ishitagopal/OneDrive - The Pennsylvania State University/Box Migration Data/Projects/state_covid_policy/analysis/network_analysis/processed_data/nodes_R1.Rds")
View(nodes)
nodes <- readRDS("/Users/ishitagopal/Downloads/nodes_R1.Rds")
View(nodes)
nodes <- readRDS("/Users/ishitagopal/Downloads/nodes_R1.Rds")
setwd("/Users/ishitagopal/OneDrive - The Pennsylvania State University/Box Migration Data/Projects/state_covid_policy/")
load("analysis/network_analysis/processed_data/cleaned_nodes.RData")
setwd("/Users/ishitagopal/OneDrive - The Pennsylvania State University/Box Migration Data/Projects/state_covid_policy/")
load("analysis/network_analysis/processed_data/cleaned_nodes.RData")
View(nodes)
table(nodes$party3)
table(nodes$party)
View(nodes)
previous_nodes <- readRDS("analysis/network_analysis/processed_data/nodes_R1.Rds")
View(previous_nodes)
names(previous_nodes)
View(previous_nodes)
names(nodes)
names(nodes) %in% names(previous_nodes)
names(previous_nodes) %in% names(nodes)
names(previous_nodes)[!names(previous_nodes) %in% names(nodes)]
?left_join
View(previous_nodes)
View(nodes)
nodes <- nodes %>%
left_join(previous_nodes%>%
select(str_id, index, race, gender, mds1), by="str_id")
View(nodes)
nodes$gender
table(nodes$gender)
table(race$gender)
table(nodes$race)
View(nodes)
saveRDS(nodes, file = "analysis/network_analysis/processed_data/cleaned_nodes_R1.Rds")
View(nodes)
pairs <- crossing(legis_1 = nodes$index,
legis_2 = nodes$index)
library(haven)
pairs <- crossing(legis_1 = nodes$index,
legis_2 = nodes$index)
library(tidyverse)
# Create party similarity matrix
pairs <- crossing(legis_1 = nodes$index,
legis_2 = nodes$index)
pairs <- pairs %>%
left_join(nodes %>%
select(index, party3), by= c("legis_1"="index"))%>%
left_join(nodes %>%
select(index, party3), by= c("legis_2"="index"))
View(pairs)
# 2 235
#1 4001 -same R
#1 4002 - R -D
View(pairs)
# Create an indicator for same race
# If party3.x == party3.y, then set same_party variable == 1
pairs$same_party <- ifelse(pairs$party3.x == pairs$party3.y, 1, 0)
# Transform the table into similarity matrix
same_race <- t(matrix(pairs$same_party, nrow = 4109))
same_race[2,235]
same_race[1, 4001]
same_race[1, 4002]
rownames(same_race)
sum(unique(nodes$name))
unique(nodes$name)
is.unique(nodes$name)
length(unique(nodes$name))
length(unique(nodes$screen_name))
is.unique(nodes$name)
!unique(nodes$name)
duplicated(nodes$name)
nodes$name[!duplicated(nodes$name)]
nodes$name[duplicated(nodes$name)]
dups <- nodes[duplicated(nodes$name),]
View(dups)
? duplicated
odes %>%
filter(name=="Jim Murphy")
nodes %>%
filter(name=="Jim Murphy")
nodes %>%
filter(name=="Michael Reilly")
nodes %>%
filter(name=="Autumn Burke")
nodes %>%
filter(name=="Mike Testa")
nodes %>%
filter(name=="Dave Williams")
rownames(same_race) <- nodes$screen_name
colnames(same_race) <- nodes$screen_name
same_race[1:5, 100:105]
saveRDS("analysis/network_analysis/processed_data/party_similarity_matrix.Rds")
rm(list=ls())
library(tidyverse)
nodes <- readRDS(nodes, file = "analysis/network_analysis/processed_data/cleaned_nodes_R1.Rds")
nodes <- readRDS(file = "analysis/network_analysis/processed_data/cleaned_nodes_R1.Rds")
# Create all the pairs of legislators
pairs <- crossing(legis_1 = nodes$index,
legis_2 = nodes$index)
# join the party of each legislator pair
pairs <- pairs %>%
left_join(nodes %>%
select(index, party3), by= c("legis_1"="index"))%>%
left_join(nodes %>%
select(index, party3), by= c("legis_2"="index"))
# Create an indicator for same race
# If party3.x == party3.y, then set same_party variable == 1
pairs$same_party <- ifelse(pairs$party3.x == pairs$party3.y, 1, 0)
# Transform the table into similarity matrix
same_party <- t(matrix(pairs$same_party, nrow = 4109))
# add row and column names to the matrix
rownames(same_party) <- nodes$screen_name
colnames(same_party) <- nodes$screen_name
saveRDS(same_party,
file = "analysis/network_analysis/processed_data/party_similarity_matrix.Rds")
rm(list=ls())
library(dplyr)
nodes <- readRDS(file = "analysis/network_analysis/processed_data/cleaned_nodes_R1.Rds")
sender_party <- matrix(nrow = dim(nodes)[1],
ncol = dim(nodes)[1])
rm(list=ls())
nodes <- readRDS(file = "analysis/network_analysis/processed_data/cleaned_nodes_R1.Rds")
table(nodes$party3)
## If the sender is a democrat --> 1, else --> 0
sender_dem <- matrix(nrow = dim(nodes)[1],
ncol = dim(nodes)[1])
sender_dem[,1:4109] <- ifelse(nodes$party3 =="D", 1, 0)
## If the sender is a republican --> 1, else --> 0
sender_rep <- matrix(nrow = dim(nodes)[1],
ncol = dim(nodes)[1])
sender_rep[,1:4109] <- ifelse(nodes$party3 =="R", 1, 0)
# Create the receiver effects matrices
# by transposing the sender effects matrices
receiver_dem <- t(sender_dem)
receiver_rep <- t(sender_rep)
sum(receiver_dem)
sender_dem[1,10,10]
sender_dem[1:10:10]
sender_dem[1:10,1:10]
sender_rep[1:10,1:10]
# Save the matrices
saveRDS(sender_dem,
file = "analysis/network_analysis/processed_data/democrat_sender_effect.Rds")
# Save the matrices
saveRDS(sender_rep,
file = "analysis/network_analysis/processed_data/republican_sender_effect.Rds")
# Save the matrices
saveRDS(receiver_dem,
file = "analysis/network_analysis/processed_data/democrat_receiver_effect.Rds")
receiver_rep <- t(sender_rep)
# Save the matrices
saveRDS(receiver_rep,
file = "analysis/network_analysis/processed_data/republican_receiver_effect.Rds")
table(nodes$gender)
use warnings()
warnings()
table(nodes$gender)
nodes %>%
filter(gender=="Non-Binary")
setwd("/Users/ishitagopal/OneDrive - The Pennsylvania State University/Box Migration Data/Projects/state_covid_policy/")
same_party <- readRDS("analysis/network_analysis/processed_data/party_similarity_matrix.Rds")
same_state <- readRDS("analysis/network_analysis/processed_data/state_similarity_matrix.Rds")
same_party[1:5,1:5]
same_state[1:5,1:5]
same_state[1:5,30:35]
same_state[1:5,40:55]
same_state[1:5,50:55]
same_party[1:5,50:55]
same_party[1:5,50:55]*same_state[1:5,50:55]
interact <- same_party*same_state
readRDS(interact,
file="analysis/network_analysis/processed_data/party_sameState_interaction_matrix.Rds")
setwd("/Users/ishitagopal/OneDrive - The Pennsylvania State University/Box Migration Data/Projects/state_covid_policy/")
same_party <- readRDS("analysis/network_analysis/processed_data/party_similarity_matrix.Rds")
same_state <- readRDS("analysis/network_analysis/processed_data/state_similarity_matrix.Rds")
interact <- same_party*same_state
same_party[1:5,50:55]*same_state[1:5,50:55]
saveRDS(interact,
file="analysis/network_analysis/processed_data/party_sameState_interaction_matrix.Rds")
setwd("/Users/ishitagopal/OneDrive - The Pennsylvania State University/Box Migration Data/Projects/state_covid_policy/analysis/network_analysis/processed_data/")
same_state[2215, 1:5]
same_state[1:5, 2215]
same_state[1:5, 2210, 2215]
same_state[1:5, 2210:2215]
same_state[2212:2217, 2212:2217]
same_state[2:7, 2212:2217]
same_state[2212:2217, 2212:2217]
nodes$keep_node <- TRUE
nodes[nodes$index == 2215,]
nodes$keep_node <- TRUE
nodes$keep_node[2215] <- FALSE
nodes[nodes$index == 2215,]
same_party <- readRDS("party_sameState_interaction_matrix.Rds")
same_party <- same_party[nodes$keep_node, nodes$keep_node]
dim(same_party)
same_party[2213:2217, 0:5]
same_state[2213:2217, 0:5]
same_party <- readRDS("party_similarity_matrix.Rds")
same_party <- readRDS("party_similarity_matrix.Rds")
same_party <- same_party[nodes$keep_node, nodes$keep_node]
saveRDS(same_party, file="party_similarity_matrix.Rds")
same_party <- readRDS("party_similarity_matrix.Rds")
dim(same_party)
rm(list = ls())
same_state <- readRDS("state_similarity_matrix.Rds")
dim(same_state)
same_state <- same_state[nodes$keep_node, nodes$keep_node]
nodes <- readRDS("cleaned_nodes_R1.Rds")
same_state <- same_state[nodes$keep_node, nodes$keep_node]
same_state <- readRDS("state_similarity_matrix.Rds")
dim(same_state)
same_state <- same_state[nodes$keep_node, nodes$keep_node]
dim(same_state)
same_state <- readRDS("state_similarity_matrix.Rds")
dim(same_state)
nodes$keep_node <- TRUE
nodes$keep_node[2215] <- FALSE
nodes[nodes$index == 2215,]
same_state <- readRDS("state_similarity_matrix.Rds")
dim(same_state)
same_state <- same_state[nodes$keep_node, nodes$keep_node]
dim(same_state)
dim(same_state)
saveRDS(same_state, file="state_similarity_matrix.Rds")
chamber_state <- readRDS("chamber_similarity_matrix.Rds")
dim(chamber_state)
chamber_state <- chamber_state[nodes$keep_node, nodes$keep_node]
dim(chamber_state)
same_chamber <- readRDS("chamber_similarity_matrix.Rds")
dim(same_chamber)
same_chamber <- same_chamber[nodes$keep_node, nodes$keep_node]
dim(same_chamber)
saveRDS(same_chamber, file="chamber_similarity_matrix.Rds")
same_gender <- readRDS("gender_similarity_matrix.Rds")
same_gender <- same_gender[nodes$keep_node, nodes$keep_node]
dim(same_gender)
same_gender <- readRDS("gender_similarity_matrix.Rds")
dim(same_gender)
same_gender <- same_gender[nodes$keep_node, nodes$keep_node]
dim(same_gender)
saveRDS(same_gender, file="gender_similarity_matrix.Rds")
same_gender[1:10,1:5]
same_race <- readRDS("race_similarity_matrix.Rds")
same_race <- readRDS("same_race.Rds")
dim(same_race)
same_race <- same_race[nodes$keep_node, nodes$keep_node]
dim(same_race)
saveRDS(same_race, file="same_race.Rds")
same_race[1:10,1:5]
same_race[50:57,1:5]
View(nodes)
interact_party <- readRDS("party_sameState_interaction_matrix.Rds")
dim(interact_party)
interact_party <- interact_party[nodes$keep_node, nodes$keep_node]
dim(interact_party)
saveRDS(interact_party, file="party_sameState_interaction_matrix.Rds")
interact_chamber <- readRDS("chamber_sameState_interaction_matrix.Rds")
dim(interact_chamber)
interact_chamber <- readRDS("chamber_sameState_interaction_matrix.Rds")
dim(interact_chamber)
interact_chamber <- interact_chamber[nodes$keep_node, nodes$keep_node]
dim(interact_chamber)
saveRDS(interact_chamber, file="chamber_sameState_interaction_matrix.Rds")
interact_gender <- readRDS("gender_sameState_interaction_matrix.Rds")
View(interact_gender)
table(names(interact_gender))
table(rownames(interact_gender))
2708+1400
dim(interact_gender)
interact_gender <- interact_gender[nodes$keep_node, nodes$keep_node]
dim(interact_gender)
saveRDS(interact_gender, file="chamber_sameState_interaction_matrix.Rds")
interact_race <- readRDS("race_sameState_interaction_matrix.Rds")
interact_race[1:5,1:5]
dim(interact_race)
interact_race <- interact_race[nodes$keep_node, nodes$keep_node]
dim(interact_race)
interact_race
saveRDS(interact_race, file="race_sameState_interaction_matrix.Rds")
dim(interact_race)
interact_gender <- readRDS("gender_sameState_interaction_matrix.Rds")
dim(interact_gender)
interact_gender <- interact_gender[nodes$keep_node, nodes$keep_node]
dim(interact_gender)
saveRDS(interact_gender, file="gender_sameState_interaction_matrix.Rds")
receiver_latino <- readRDS("receiver_latino.Rds")
dim(receiver_latino)
receiver_latino <- receiver_latino[nodes$keep_node, nodes$keep_node]
dim(receiver_latino)
saveRDS(receiver_latino, file="receiver_latino.Rds")
receiver_mena <- readRDS("receiver_mena.Rds")
dim(receiver_mena)
receiver_mena <- receiver_mena[nodes$keep_node, nodes$keep_node]
dim(receiver_mena)
saveRDS(receiver_mena, file="receiver_mena.Rds")
receiver_asian <- readRDS("receiver_asian.Rds")
dim(receiver_asian)
receiver_asian <- receiver_asian[nodes$keep_node, nodes$keep_node]
dim(receiver_asian)
saveRDS(receiver_asian, file="receiver_asian.Rds")
receiver_black <- readRDS("receiver_black.Rds")
dim(receiver_black)
receiver_black <- receiver_black[nodes$keep_node, nodes$keep_node]
dim(receiver_black)
saveRDS(receiver_black, file="receiver_black.Rds")
receiver_native <- readRDS("receiver_native.Rds")
dim(receiver_native)
receiver_native <- receiver_native[nodes$keep_node, nodes$keep_node]
dim(receiver_native)
saveRDS(receiver_native, file="receiver_native.Rds")
receiver_multi <- readRDS("receiver_multi.Rds")
dim(receiver_multi)
receiver_multi <- receiver_multi[nodes$keep_node, nodes$keep_node]
dim(receiver_multi)
saveRDS(receiver_multi, file="receiver_multi.Rds")
sender_multi <- readRDS("sender_multi.Rds")
dim(sender_multi)
sender_multi <- sender_multi[nodes$keep_node, nodes$keep_node]
dim(sender_multi)
saveRDS(sender_multi, file="sender_multi.Rds")
sender_asian <- readRDS("sender_asian.Rds")
dim(sender_asian)
sender_asian <- sender_asian[nodes$keep_node, nodes$keep_node]
dim(sender_asian)
saveRDS(sender_asian, file="sender_asian.Rds")
sender_mena <- readRDS("sender_mena.Rds")
dim(sender_mena)
sender_mena <- sender_mena[nodes$keep_node, nodes$keep_node]
dim(sender_mena)
saveRDS(sender_mena, file="sender_mena.Rds")
rm(list=ls())
sender_native <- readRDS("sender_native.Rds")
dim(sender_native)
sender_native <- sender_native[nodes$keep_node, nodes$keep_node]
nodes <- readRDS("cleaned_nodes_R1.Rds")
sender_native <- readRDS("sender_native.Rds")
dim(sender_native)
sender_native <- sender_native[nodes$keep_node, nodes$keep_node]
dim(sender_native)
nodes$keep_node <- TRUE
nodes$keep_node[2215] <- FALSE
nodes[nodes$index == 2215,]
rm(list=ls())
sender_native <- readRDS("sender_native.Rds")
dim(sender_native)
sender_native <- sender_native[nodes$keep_node, nodes$keep_node]
dim(sender_native)
rm(list = ls())
nodes <- readRDS("cleaned_nodes_R1.Rds")
nodes$keep_node <- TRUE
nodes$keep_node[2215] <- FALSE
sender_native <- readRDS("sender_native.Rds")
dim(sender_native)
sender_native <- sender_native[nodes$keep_node, nodes$keep_node]
dim(sender_native)
saveRDS(sender_native, file="sender_native.Rds")
sender_latino <- readRDS("sender_latino.Rds")
dim(sender_latino)
sender_latino <- sender_latino[nodes$keep_node, nodes$keep_node]
dim(sender_latino)
saveRDS(sender_latino, file="sender_latino.Rds")
sender_black <- readRDS("sender_black.Rds")
dim(sender_black)
sender_black <- sender_black[nodes$keep_node, nodes$keep_node]
dim(sender_black)
saveRDS(sender_black, file="sender_black.Rds")
profeshScore_diff <- readRDS("profeshScore_diff.Rds")
dim(profeshScore_diff)
profeshScore_diff <- profeshScore_diff[nodes$keep_node, nodes$keep_node]
dim(profeshScore_diff)
saveRDS(profeshScore_diff, file="profeshScore_diff.Rds")
receiver_profesh <- readRDS("receiver_profesh.Rds")
dim(receiver_profesh)
receiver_profesh <- receiver_profesh[nodes$keep_node, nodes$keep_node]
dim(receiver_profesh)
saveRDS(receiver_profesh, file="receiver_profesh.Rds")
sender_profesh <- readRDS("sender_profesh.Rds")
dim(sender_profesh)
sender_profesh <- sender_profesh[nodes$keep_node, nodes$keep_node]
dim(sender_profesh)
saveRDS(sender_profesh, file="sender_profesh.Rds")
house_sender <- readRDS("house_sender_matrix.Rds")
dim(house_sender)
house_sender <- house_sender[nodes$keep_node, nodes$keep_node]
dim(house_sender)
saveRDS(house_sender, file="house_sender_matrix.Rds")
house_receiver <- readRDS("house_receiver_matrix.Rds")
house_receiver <- readRDS("house_receiver_matrix.Rds")
dim(house_receiver)
house_receiver <- house_receiver[nodes$keep_node, nodes$keep_node]
dim(house_receiver)
saveRDS(house_receiver, file="house_receiver_matrix.Rds")
house_sender <- readRDS("house_sender_matrix.Rds")
dim(house_sender)
house_sender <- house_sender[nodes$keep_node, nodes$keep_node]
house_sender[1:5]
house_sender[1:5,1:4]
house_sender <- readRDS("house_receiver_matrix.Rds")
dim(house_sender)
republican_sender <- readRDS("republican_sender_effect.Rds")
dim(republican_sender)
republican_sender <- republican_sender[nodes$keep_node, nodes$keep_node]
dim(republican_sender)
saveRDS(republican_sender, file="republican_sender_effect.Rds")
democrat_sender <- readRDS("democrat_sender_effect.Rds")
dim(democrat_sender)
democrat_sender <- democrat_sender[nodes$keep_node, nodes$keep_node]
dim(democrat_sender)
saveRDS(democrat_sender, file="democrat_sender_effect.Rds")
democrat_receiver <- readRDS("democrat_receiver_effect.Rds")
dim(democrat_receiver)
democrat_receiver <- democrat_receiver[nodes$keep_node, nodes$keep_node]
dim(democrat_receiver)
saveRDS(democrat_receiver, file="democrat_receiver_effect.Rds")
republican_receiver <- readRDS("republican_receiver_effect.Rds")
rm(list = ls())
republican_receiver <- readRDS("republican_receiver_effect.Rds")
dim(republican_receiver)
republican_receiver <- republican_receiver[nodes$keep_node, nodes$keep_node]
nodes <- readRDS("cleaned_nodes_R1.Rds")
nodes$keep_node <- TRUE
nodes$keep_node[2215] <- FALSE
nodes[nodes$index == 2215,]
republican_receiver <- republican_receiver[nodes$keep_node, nodes$keep_node]
dim(republican_receiver)
saveRDS(republican_receiver, file="republican_receiver_effect.Rds")
gender_sender_matrix <- readRDS("gender_sender_matrix.Rds")
dim(gender_sender_matrix)
gender_sender_matrix <- gender_sender_matrix[nodes$keep_node, nodes$keep_node]
dim(gender_sender_matrix)
saveRDS(gender_sender_matrix, file="gender_sender_matrix.Rds")
gender_receiver_matrix <- readRDS("gender_receiver_matrix.Rds")
dim(gender_receiver_matrix)
gender_receiver_matrix <- gender_receiver_matrix[nodes$keep_node, nodes$keep_node]
dim(gender_receiver_matrix)
saveRDS(gender_receiver_matrix, file="gender_receiver_matrix.Rds")
contig_states_matrix <- readRDS("contig_states_matrix.Rds")
dim(contig_states_matrix)
contig_states_matrix <- contig_states_matrix[nodes$keep_node, nodes$keep_node]
dim(contig_states_matrix)
saveRDS(contig_states_matrix, file="contig_states_matrix.Rds")
dim(contig_states_matrix)
mentions_adjacencyMatrix <- readRDS("mentions_adjacencyMatrix.Rds")
dim(mentions_adjacencyMatrix)
rownames(mentions_adjacencyMatrix)[1:5]
rownames(mentions_adjacencyMatrix)[2215]
rownames(mentions_adjacencyMatrix)[2214:2216]
mentions_adjacencyMatrix <- mentions_adjacencyMatrix[nodes$keep_node, nodes$keep_node]
dim(mentions_adjacencyMatrix)
rownames(mentions_adjacencyMatrix)[2214:2216]
saveRDS(mentions_adjacencyMatrix, file="mentions_adjacencyMatrix.Rds")
followers_adjacencyMatrix <- readRDS("followers_adjacencyMatrix.Rds")
dim(followers_adjacencyMatrix)
followers_adjacencyMatrix <- followers_adjacencyMatrix[nodes$keep_node, nodes$keep_node]
rownames(mentions_adjacencyMatrix)[2214:2216]
saveRDS(followers_adjacencyMatrix, file="followers_adjacencyMatrix.Rds")
dim(followers_adjacencyMatrix)
retweets_adjacencyMatrix <- readRDS("retweets_adjacencyMatrix.Rds")
dim(retweets_adjacencyMatrix)
retweets_adjacencyMatrix <- retweets_adjacencyMatrix[nodes$keep_node, nodes$keep_node]
rownames(mentions_adjacencyMatrix)[2214:2216]
retweets_adjacencyMatrix <- readRDS("retweets_adjacencyMatrix.Rds")
dim(retweets_adjacencyMatrix)
retweets_adjacencyMatrix <- readRDS("rewtweets_adjacencyMatrix.Rds")
retweets_adjacencyMatrix <- readRDS("retweets_adjacencyMatrix.Rds")
dim(retweets_adjacencyMatrix)
rownames(mentions_adjacencyMatrix)[2214:2216]
rm(list = ls())
retweets_adjacencyMatrix <- readRDS("retweets_adjacencyMatrix.Rds")
dim(retweets_adjacencyMatrix)
rownames(retweets_adjacencyMatrix)[2214:2216]
retweets_adjacencyMatrix <- retweets_adjacencyMatrix[nodes$keep_node, nodes$keep_node]
nodes <- readRDS("cleaned_nodes_R1.Rds")
nodes$keep_node <- TRUE
nodes$keep_node[2215] <- FALSE
nodes[nodes$index == 2215,]
retweets_adjacencyMatrix <- retweets_adjacencyMatrix[nodes$keep_node, nodes$keep_node]
rownames(retweets_adjacencyMatrix)[2214:2216]
dim(retweets_adjacencyMatrix)
saveRDS(retweets_adjacencyMatrix, file="retweets_adjacencyMatrix.Rds")
